package com.billy.ohos.swipe.demo.consumer;


import com.billy.ohos.swipe.SmartSwipe;
import com.billy.ohos.swipe.SwipeConsumer;
import com.billy.ohos.swipe.consumer.StretchConsumer;
import com.billy.ohos.swipe.demo.BaseRecyclerViewAbility;
import com.billy.ohos.swipe.demo.ResourceTable;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

/**
 * demo:
 * @author billy.qi
 */
public class StretchConsumerAbility extends BaseRecyclerViewAbility {

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        swipeConsumerView =  SmartSwipe.wrapView(recyclerView).addConsumer(new StretchConsumer()).enableVertical();
    }

    @Override
    public int getTitleResId() {
        return ResourceTable.String_demo_ui_StretchConsumer;
    }

    @Override
    protected ViewHolder createRecyclerViewHolder(Component view) {
       itemConsumer = SmartSwipe.wrapView(view).addConsumer(new StretchConsumer()).enableHorizontal();
        return new ViewHolder(itemConsumer.getWrapper());
    }

}
